<template>
	<view class="steps">
		<view class="steps_list">
			<view class="node" :class="{'active-node':item.activity == item.index}" ></view>
			<view class="tail" :class="{'active-tail':item.activity == item.index}" :hidden="item.index == 0"></view>
		</view>
		<view class="wrapper">
			<view class="date" >
				{{item.wrapperStatus}}
			</view>
			<view class="content">
				<view class="content_r">
					<view class="name">
						<text>{{item.name}}</text>
					</view>
					<view class="scan_time" v-if="item.approveresult">
						<text>审批意见 :{{item.approveresult}}</text>
					</view>
					<view class="scan_time" v-if="item.date">
						审批时间 : {{item.date}}
					</view>
					<view class="scan_time-explain" v-if="item.explain">
						<text class="title">说明：</text>
						<text>{{item.explain}}</text>
					</view>
					<view class="scan_time" v-if="item.checknote">
						批语 : {{item.checknote}}
					</view>
					<!-- <view class="scan_time" v-if="item.date">
						批语 : {{item.checknote}}
					</view> -->
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	/*
	item：没条记录详情
	activity: 当前进度条状态
	wrapperStatus：流程状态对应字段
	wrapperTitle：详情对应字段
	index：进度条排列序号 index == 0代表最后一个没有竖立进度条
	date：时间
	 */
	export default {
		name: 'm-steps',
		data() {
			return {

			}
		},
		props: {
			item: {
				type: Object,
			},
		},
		methods: {

		},
		created() {
			console.log(this.item,'item')
		}
	}
</script>

<style lang="scss" scoped>
	.scan_time-explain{
		display: flex;
		font-size: 12px;
		color: #aaa;
		margin: 8px 0 0;
		.title{
			width: 150rpx;
		}
	}
	.steps {
		display: flex;
		background-color: #ffffff;
		
		.steps_list {
			display: flex;
			flex-direction: column;
			align-items: center;
			padding: 0 10px;
		}

		.date {
			color: #303030;
			text-align: left;
		}
		.wrapper {
			width: 100%;
		}
		.tail {
			height: calc(100% - 15px);;
			width: 2px;
			background-color:  #eee;
		}
		.active-tail {
			width: 2px;
			background-color:  #0089FF !important;
		}

		.active-node {
			background-color: #0089FF !important;
		}

		.node {
			width: 15px;
			height: 15px;
			background-color: #aaa;
			border-radius: 50%;
		}
		.content {
			width: 95%;
			display: flex;
			padding: 10px 20rpx;
			margin-bottom: 10px;
		}

		.content_l {
			width: 25%;
			display: flex;
			align-items: center;
			justify-content: center;

			image {
				width: 50px;
				height: 50px;
				border-radius: 5px;
			}
		}

		.content_r {
			width: 70%;
			
			.name {
				font-weight: 800;
				font-size: 16px;
			}

			.scan_time {
				font-size: 12px;
				color: #aaa;
				margin: 8px 0 0;
			}
		}
	}
</style>
